package com.mit.wx.entity;

import com.mit.wx.wx.dto.SourceMessage;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.persistence.*;

/**
 * 2018/10/9 Create by 郭文梁
 * WxSourceMessage
 * 微信消息实体类
 *
 * @author 郭文梁
 * @date 2018/10/9
 */
@Data
@Entity
@Table(name = "wx_source_message")
public class WxSourceMessage {
    public static WxSourceMessage of(SourceMessage source) {
        WxSourceMessage target = new WxSourceMessage();
        BeanUtils.copyProperties(source, target);
        return target;
    }

    @Id
    @GeneratedValue
    private Integer id;
    private String toUserName;
    private String fromUserName;
    private String createTime;
    private String msgType;
    private String content;
    private String msgId;
    private String mediaId;

    private String picUrl;
}
